An operation system in a common computing device accesses a storage device and uses a file system to read and write the file. A file system, which has been recently used in most computing devices, is EXT4 (extended file system 4). EXT4 is a file system supporting journaling to guarantee consistency and maintainability. Journaling is a technique that can restore the file system fast, when the system is suddenly terminated due to occurrence of a system failure, a supply error or other problems. EXT4 periodically records a journal log in a journal area, which is a pre-reserved area of the storage device, in order to execute the journaling.
The journaling method of EXT4 supports a write-back mode, an ordered mode, and a data mode. The ordered mode is a basic option for the journaling method of EXT4. To maintain the consistency of the file system, the ordered mode records only metadata in the journal area after all data that need to be updated are recorded in the storage device.
When the journaling method is executed, a journal thread executed in a background is used for data storage requiring the longest time. As such, long response time resulting therefrom may not be a problem. However, since an fsync system call is not executed in a background, the response time of the journaling may be critical upon the fsync system call.
The fsync system call is a system call function of Linux. The fsync system call is intended to be guaranteed as to whether changes in a file designated by a user have been surely recorded in the storage device. In EXT4, the fsync system call records all corrected metadata of a compound transaction in the journal area by using the journaling thread. In this case, the compound transaction is a group of file system updates. When a file calculation occurs, EXT4 executes journaling per compound transaction, instead of executing journaling per single transaction. The compound transaction may include a file, which is not included in the fsync system call. If there are significant changes in a file that has not been requested, the execution time for the fsync system call may increase.
Conventional inventions to solve this problem are described below.
Korean Patent Publication No. 10-0981064 (Title of Invention: “A Method to Maintain Software Raid Consistency Using Journaling File System”) describes a journaling method, which updates information by registering a journal transaction descriptor block, a data block, and a metadata block in a memory buffer. This method splits a storage area into a multiple number of block groups, and executes journaling by using each of the blocks. The block generated in this invention is stored in a cache, and simultaneously, used to be stored in a disk during an ordered journaling process. However, since the block generated in this invention is stored in a cache, and simultaneously, used to be stored in a storage device during an ordered journaling process, an amount of metadata and files to be processed at a time is maintained. Thus, the execution time for the fsync system call is not reduced.
Korean Patent Publication No. 10-2005-0052016 (Title of Invention: “Method of and apparatus for logging and restoring the meta data in file system”) describes changing metadata per transaction, and stores a log of the changed metadata in a global log buffer unit. This method identifies any change in the metadata stacked in the buffer by using the metadata log, and stores the change in a disk. However, since this method executes journaling per transaction, it cannot solve the problem of increase of execution time for the fsync system call resulting from storing unnecessary files when the fsync system call is executed.
In addition, Korean Patent Publication No. 10-0453228 (Title of Invention: “Journaling and Recovery Method of Shared Disk File System”) describes identifying any change in metadata stacked in a buffer by using a metadata log and storing the change in a storage device. Since this invention also executes journaling per transaction, execution time for the fsync system call may increase due to storing of unnecessary files upon the execution of the fsync system call.